<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/17 0017
 * Time: 13:43
 */

namespace app\common\model;


use think\Model;

class LoansApplylist extends Model
{
    public function SelectData($whereArr,$field = "*"){
        if (empty($whereArr)){
            return $this->query('select '.$field.' from xb_loans_applylist');
        }else{
            $str = '';
            foreach ($whereArr as $k=>$v){
                $str.= $k.'=:'.$k.' and';
            }
            $str = rtrim($str,'and');
            $data = $this->query('select '.$field.' from xb_loans_applylist where '.$str.'limit 1',$whereArr);
            return !empty($data)?$data[0]:[];
        }
    }
}